package cn.shu.Factory;

/**
 * Created by 76062 on 2017/9/22.
 */
public class CarFactory {

    public static Object getClz(Class<? extends Car> clazz) {

        Object obj = null;
        try {
            obj = Class.forName(clazz.getName()).newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return obj;
    }
}
